home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 09-11.C < prev    next >
Text File  |  1992-01-31  |  676b  |  36 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char triangle[] = {
  8.    0x17,9,1, 0x12,1,5, 0x17,1,3, 0x12,1,3,
  9.    0x17,1,5, 0x12,1,1, 0x17,1,7, 0x17,1,4
  10.    };
  11.  
  12. void main()
  13. {
  14.    int old_mode, new_mode;
  15.  
  16.    new_mode = fg_bestmode(320,200,1);
  17.    if (new_mode < 0 || new_mode == 12) {
  18.       printf("This program requires a 320 ");
  19.       printf("x 200 color graphics mode.\n");
  20.       exit(1);
  21.       }
  22.  
  23.    old_mode = fg_getmode();
  24.    fg_setmode(new_mode);
  25.  
  26.    fg_setcolor(7);
  27.    fg_rect(0,319,0,199);
  28.  
  29.    fg_move(156,101);
  30.    fg_displayp(triangle,16,9);
  31.    fg_waitkey();
  32.  
  33.    fg_setmode(old_mode);
  34.    fg_reset();
  35. }
  36.